#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   run.py
@Time    :   2020/09/21 15:06:05
@Author  :   fengzhilaoling 
@Version :   1.0
@Contact :   fengzhilaoling@163.com
'''
from flask import Flask
from db_util import DBUtil

app = Flask(__name__)


@app.route('/index')
def show():
    db = DBUtil(user='fengling', pwd='123456', host='39.96.7.141', db='ceshi')
    sql = 'select * from student2 where sno=108'
    result = db.query(sql)
    print(result)
    a = result[0]['sname']
    return a


if __name__ == '__main__':
    app.run(debug=True)